package com.thomas.jvm;

/**   
* @Description: VM Args: -Xss2M 
* @author thomas_liu  
* @date 2018年6月13日 上午9:55:18 
* @version V1.0   
*/
public class JavaVMStackOOM {
	
	private void dontStop() {
		while(true){
			
		}
	}
	
	public void stackLeakByThread() {
		while(true){
			Thread thread = new Thread(){
				@Override
				public void run() {
					super.run();
					dontStop();
				}
			};
			thread.start();
		}
	}
	
	public static void main(String[] args) {
		JavaVMStackOOM oom = new JavaVMStackOOM();
		oom.stackLeakByThread();
	}
	

}
